<link rel="stylesheet" type="text/css" href="<?=MY_URL?>/html/styles/plugin/jquery.lightbox-0.5.css" />
<script type="text/javascript" src="<?=MY_URL?>/html/scripts/plugin/jquery.lightbox-0.5.pack.js"></script>
<style type="text/css">
div.pdp-pajamafybox_shorts {
width:600px;
background: url("/images/accessory.png") no-repeat scroll 0px center #FEF6D3;
font-weight: bold;
margin:auto;
padding: 16px 5px 16px 15px !important;
border: 1px solid rgb(204, 204, 204);
}
span#pdp-pajamafy-shownow, #pdp-pajamafy-shownow_second {
background: -moz-linear-gradient(#FFFFFF, #CCCCCC) repeat scroll 0 0 transparent;
border: 1px solid #999;
cursor: pointer;
font-weight: normal;
margin-left: 5px;
padding: 3px 6px;
}
.all_product{
	margin-bottom:20px;
}
.box, .box-grid, .box-cols {
position: relative;
height: 1%;
width: auto;
margin-bottom: 20px;
}
.rounded {
border-radius: 5px 5px 5px 5px;
}
.center {
text-align: center;
}
.pdp-pajamafy-swatch, .pdp-pajamafy-swatch_second {
background-color: white;
border: 1px solid #C1C1BF;
cursor: pointer;
float: left;
height: 48px;
margin-bottom: 5px;
margin-right: 5px;
width: 48px;
padding: 1px;
}
.pdp-pajamafy-swatch:hover {
border: 2px solid #666;
height: 46px;
width: 46px;
padding: 1px;
}
.pdp-pajamafy-swatch-selected, .pdp-pajamafy-swatch-selected_second {
border: 2px solid #666;
height: 46px;
width: 46px;
background-color: white;
cursor: pointer;
float: left;
margin-bottom: 5px;
margin-right: 5px;
padding: 1px;
}
.clear {
clear: both;
height: 1px;
}
.whiteprice{
float:left;
width:240px;
height:146px;
padding-left:20px;
}

</style>
<form action="/product-addtocart" method="post" id="addtocartform">
<div class="g-bd clearfix">
		<?php echo $this->render('index/left.phtml');?> 
        <!-- 主栏 -->
        <div class="fcj_menu">
		    <div class="fcj_blk0 fcj_producti_show">
                <h2 class="blk0h2 f-iblk clearfix">
                	<span class="spbg blkhdl"><a href="<?php echo MY_URL;?>">Home</a> &gt; <span itemprop="category"><?php echo $this->parentArray[count($this->parentArray)-2];?></span> &gt; <?php echo mb_substr($this->parentArray[count($this->parentArray)-1],0,30);?>...</span>
                    <span class="spbg blkhdr">&nbsp;</span>
                </h2>
                <div class="blkbody">
                	<div class="pdinfo clearfix">
                        <div class="psimg">
                            <div class="pbimg">
                                <span itemprop="image"><img style="width: 258px;" src="<?=MY_URL?>/<?=$this->itemDetailArray[0]['medium_url']?>" onerror="javascript:this.src ='<?=MY_URL?>/html/images/nothingpic.jpg'"/></span>
                            	
                            </div>
                            <div class="pimginfo">
                            	<input class="w-btn-blue0 spbg w-btn-blue0-0" type="button" value="LARGER IMAGE &amp; ADDITIONAL VIEWS" onclick="$('#gallery :first').find('a').click();"/>
                            </div>
                            <div class="psimgs">
                            	<ul class="clearfix" id="gallery">
                            		<?foreach($this->attachmentArray as $value):?>
							          <li><span itemprop="image"><a href="<?=MY_URL?>/<?=$value['attachment_url']?>"><img src="<?=MY_URL?>/<?=$value['cut_url']?>" alt="<?=$value['intro']?>" onerror="javascript:this.src ='<?=MY_URL?>/html/images/nothingpic.jpg'" /></a></span></li>
							        <?endforeach;?>
                                </ul>
                            </div>
                            <div class="psship-info">
                            	<div><strong>Delivery</strong>: Estimated 7-15 days. <a href="/bulletin-more-itemid-1271/Free_Shipping_per_Order/">For more&gt&gt</a></div>
                                <div><strong>Shipping</strong>: Free shipping to USA, Canada, <br /><span>Western Europe, Oceania</span></div>
                                <div><strong>Returns</strong>: Free 365 Day Return Policy</div>
                            </div>
                        </div> 
                  		<div class="pdmore">
                        	<h1 class="pdtitle"><span itemprop="name"><?=$this->itemDetailArray[0]['subject']?><?php if($this->isFlashSale):?> <span style="color:red">(GAGA Deal processing)</span><?php endif;?></span> <?php if($this->isSuit==1):?><strong style="color:red;">Team-buying Discount</strong><?php endif;?></h1>
                            <div class="pdprice pitem clearfix">
                            	<div><span style="float: left;display: inline;line-height: 29px;">SALE!</span><span class="jersey-price" itemprop="price" style="float: left;display: inline;line-height: 29px;margin: 0 10px;"> $<?php echo $this->itemDetailArray[0]['max_price']?></span><input style="float: left;display: inline;line-height: 29px;" class="spbg exchange" type="button" value="Exchange To Euros" onclick="GGSHOP.exchange.euros(this);" /></div>
                            	<div style="display: none;"><span style="float: left;display: inline;line-height: 29px;">SALE!</span><span class="jersey-price" style="float: left;display: inline;line-height: 29px;margin: 0 10px;"> €<?php echo number_format ($this->itemDetailArray[0]['max_price']*EXCHANGE_RATE,2)?></span><input style="float: left;display: inline;line-height: 29px;" class="spbg exchange" type="button" value="Exchange To USD" onclick="GGSHOP.exchange.usd(this);" /></div>
                            </div>
                            <?php $mlm = new CMlm(); ?>    
        					<?php if ($mlm->isMlmUserFirstBuy(isset($_COOKIE[COOKIE_PRE . 'uid']) ? $_COOKIE[COOKIE_PRE . 'uid']:0)):?>
                            <p class="description" style="color: red;font-weight: bold;">
                            	WOW!!Confirm your payment, you will save <?php echo 10;?>% of your total price!!
                            </p>
                            <?php endif;?>
                            <p class="description">
                            	<span itemprop="description"><?php echo $this->itemDetailArray[0]['description']; ?> &gt;&gt; <a href="#description">read more</a></span>
                            </p>                            
                            <div class="pdcomment clearfix pitem" style="margin-bottom:5px;">
                            	<?php if($this->avgAll>0):?>
                            		<?php for($i=0; $i<$this->avgAll; $i++):?>
                                    <span class="star re-star g-star">&nbsp;</span>
                                    <?php endfor;?>
                                    <?php for($i=0; $i<5-$this->avgAll; $i++):?>
                                    <span class="star re-star b-star">&nbsp;</span>
                                    <?php endfor;?>  
                                <span class="item">(<?php echo $this->avgAll;?> Stars)&nbsp;&nbsp;</span>     
                                <?php endif;?>                                                                                    
                            </div>
                            <div>
                            	<div class="whiteprice">
	                            	<div style="font-weight:bold;width:80px;float:left;text-align:center;border-bottom: 1px #E0E0E0 solid;padding-bottom:10px;padding-top:5px;">Quantity</div>
	                            	<div class="item-bd-hd" style="font-weight:bold;text-align:center;width:140px;float:left;border-bottom: 1px #E0E0E0 solid;padding-bottom:10px;padding-top:5px;">Wholesale Price</div>
		                            <div class="clear"></div>
		                            <?foreach($this->priceArray as $value):?>
		                            	<div class="price-lev clearfix">                            	
		                                    <div class="item-bd-hd" style="width:80px;"><?=$value['min_counts']?>-<?=$value['max_counts']?></div>
											<div class="item-bd-hd-con" style="width:140px;float:left;">$<?php echo $value['net_price'];?>/€<?php echo number_format ($value['net_price']*EXCHANGE_RATE,2)?> each</div>
		                                
		                                </div>
		                            	<input type="hidden" name="min_counts[]" value="<?=$value['min_counts']?>" />
							            <input type="hidden" name="max_counts[]" value="<?=$value['max_counts']?>" />	
		                            <?endforeach;?>
                            	</div>
                            	<div style="padding-top:55px;float:left;"><a href="/product-moredeals"><img src="/images/moredeal.png"></a></div>
                            	<div class="clear"></div>
                            	
                            </div>
	                            
                            
                            
                            <div class="pdsizeCount pitem">
                            	<div class="psize clearfix">
                                	<label class="lbtitle f-blk"><a style="font-size:10px;text-decoration:underline;" target="_blank" href="http://www.fancycheapjersey.com/bulletin-more-itemid-1273/Size_Chart/" id="showSizeChart">Adult Size Chart</a></label>
                                	<?php foreach($this->pattern_size as $value):?>
                                	<span class="lbitem f-blk"><?php echo $value;?></span>
                                	<?php endforeach;?>
                                </div>
                                <div class="pcount clearfix">
                                	<label class="lbtitle f-blk">Quantity</label>
                                	<?php for($i=0,$len=count($this->pattern_size);$i<$len;$i++):?>    
                                	<span class="lbitem f-blk">              
                     				<input type="hidden" value="<?=$this->pattern_size[$i]?>" name="pattern_size[]" />                    
                      				<input onkeyup="this.value=this.value.replace(/[^\d]/g,'')" pv="<?=$this->pattern_size[$i]?>" name="counts[]" class="psize" type="text" value="0" />
                 					</span>
                 					<?php endfor;?> 
                 					<input type="hidden" name="pattern_name" value="<?=$this->priceArray[0]['pattern_name']?>" />
                 					<input type="hidden" name="itemid" value="<?=$this->itemid?>" />                               	
                                </div>
                            </div>  
                            <?php if ($this->itemDetailArray[0]['is_showed'] != 0):?>                         
							<?if(($this->itemDetailArray[0]['proPrintnumber']) || !empty($this->select_badgepatch)):?>
                            <div class="pdcustomize pitem">
                            	<a class="custom-btn f-blk spbg" href="javascript: void(0);" onclick="GGSHOP.product.showCustom();divSelectInit();">Print Name and Number or Patch</a>
                            </div>
                            <?php endif;?>      
                            <?php endif;?>
                            <?php if($this->adata):?>
                            <div id="productlink1" class="box pdp-pajamafybox_shorts center rounded" style="height:40px;width:380px;margin-bottom:10px;background: url('/images/accessory.png') no-repeat scroll -7px center #FEF6D3;">
                            	<div style="width: 210px;float:left;margin-left:70px; text-align:left; padding-top: 6px; ">
                            		<div>Would you like to add matching</div>
                            		<div style="text-align:left;">accessory to your shirt?</div>
                            	</div>
                            	<div style="float:left;padding-top:10px;width:100px;" id="producthtml"><span  onclick="showmyproduct();" id="pdp-pajamafy-shownow" class="rounded" style="padding:3px 1px;margin-left:1px;">Show Products</span></div>
                			</div>
                			<?php endif;?>                
                            <input type="hidden" name="addNameNum" value="0"></input>

							<?php if ($this->itemDetailArray[0]['is_showed'] != 0):?>
                            <?php if($this->stocknum==0):?>
                            <div class="paddcart pitem">
                            		Out of stock.
                            </div>
                            <?php else:?>
                            <div class="paddcart pitem">
                            	<input type="submit" class="spbg" value="ADD TO SHOPPING CART" onclick="return GGSHOP.product.check()"/>
                                <div class="cartinfo" style="display: none;">In Stock and Ready to Ship! Sold by fancycheapjersey Retail, Inc.&nbsp;&nbsp;&nbsp;<a href="#">Shipping Options</a></div>
                            </div>
                            <?php endif;?>
                            <?php else: ?>
                            
                            <div class="paddcart pitem">
                            	Sorry, this shirt has been sold out.
                            </div>
                           <?php endif;?>

							<?php if($this->member_type!="buyer"):?>
	                            <div style="margin:10px 0px 0px 0px;" class="clearfix">
									<div style="float:left;margin:0px 0px 0px 0px;font-sise:17px;font-weight:bold;">Share then earn $<?php echo number_format($this->rebatePersent * $this->itemDetailArray[0]['max_price']/100,2);?> if your 1 friend buy it. <a href="/bring-a-friend-and-earn-with-us" style="text-decoration:underline;">Earn more.</a></div>
									<a href="/auth-login?preurl=<?php echo urlencode($this->url($this->itemDetailArray[0]['itemid']));?>" class="f-iblk" style="float:left;width:226px;height:39px;background:url(/images/mlm/share.jpg) center no-repeat;" ></a>
								</div>
                            <?php else:?>
                            	<div style="margin:10px 0px 0px 0px;" class="clearfix">
                            		<div style="float:left;margin:0px 0px 0px 5px;font-sise:17px;font-weight:bold;">Share then earn $<?php echo number_format($this->rebatePersent * $this->itemDetailArray[0]['max_price']/100,2);?> if your 1 friend buy it. <a href="/bring-a-friend-and-earn-with-us" style="text-decoration:underline;">Earn more.</a></div>
									<span class="f-iblk" style="float:left;width:226px;height:39px;" id="shareThisBtn" ></span>
								</div>
								<script type="text/javascript">
									$(function(){
										stLight.options({publisher: "f0e640f7-8760-4a55-b739-e5aae5ea99e2", doNotHash: false, doNotCopy: false, hashAddressBar: true});
										stWidget.addEntry({
											"service":"sharethis",
											"element":document.getElementById('shareThisBtn'),
											"url":"<?php echo MY_URL;?>/index.php?controller=product&action=detail&id=<?php echo $this->itemDetailArray[0]['itemid'];?>&invite=<?php echo $this->inviteCode;?>",
											"title":"<?=intval(($this->itemDetailArray[0]['m_org_price']-$this->itemDetailArray[0]['max_price'])/$this->itemDetailArray[0]['m_org_price']*100)?>% OFF on <?php echo $this->itemDetailArray[0]['subject'];?>",
											"type":"large",
											"text":"Hey buddy, save 10% for soccer jersey and start earning your great fortune!" ,
											"image":"<?php echo MY_URL;?>/<?php echo $this->itemDetailArray[0]['cut_url'];?>",
											"summary":"Hey buddy, save <?=intval(($this->itemDetailArray[0]['m_org_price']-$this->itemDetailArray[0]['max_price'])/$this->itemDetailArray[0]['m_org_price']*100)?>% on this awesome jersey!"   
										});
										$('#shareThisBtn').find('.stLarge').css('background','url(/images/mlm/share.jpg) no-repeat center');
										$('#shareThisBtn').find('.stLarge').addClass('f-iblk');
										$('#shareThisBtn').find('.stLarge').css('width','226px');
										$('#shareThisBtn').find('.stLarge').css('height','39px');
										$('#inlinkInput').click(function(){
											$(this).select();
										});
										$('#incodeInput').click(function(){
											$(this).select();
										});
										$('#dontremindme').click(function(){
											var date=new Date(); 
											var expireDays=10; 
											date.setTime(date.getTime()+expireDays*24*3600*1000); 
											document.cookie="zcshop_mlmtips=no;expire="+date.toGMTString(); 
											$('#invitationCopy').hide();
										});
									});
								</script>
                            <?php endif;?>


                            <div class="pshare clearfix pitem">
                                <a onClick="myFavorite.addItemFavor('<?=$this->itemDetailArray[0]['itemid']?>');" href="javascript:;" class="spbg add-to-favr">ADD TO MY WISH LIST</a>
                            </div>
                        </div>
                    </div>
                    <div class="spbg2 pd-adver">
                        <strong>WOW!</strong>
		            	<span>
		            		<span>Free Shipping</span>
		            		<span class="spbg2">Free Returns</span>
		            		<span class="spbg2">Free 365 Day Return Policy</span>
		            		<span class="spbg2">24/7 Customer Service</span>
		            	</span>
                    </div>
                    <div class="pd-description">
                    	<h3>PRODUCT INFOMATION</h3>

                    	<?php foreach($this->attachmentArray as $value):?>
                    	<?php if($value['cut_url'] == $this->itemDetailArray[0]['cut_url']):?>
                    	<div style="text-align:center;"><img src="<?=MY_URL?>/<?php echo $value['attachment_url']; ?>" style="max-width:680px;margin:10px;" /></div>
				        <?php endif;?>
				        <?endforeach;?>
				        
				        <div style="text-align:center;padding:10px;">
				        	<h4 style="margin-bottom:5px;">Size for Adult:</h4>
				        	<div><img src="http://www.fancycheapjersey.com/html/upload/item_img/201212/1/0135513058091645314sizechart.jpg" /></div>
				        </div>
				        
				        <div style="text-align:center;padding:10px;">
				        	<div><img src="http://www.fancycheapjersey.com/images/you.jpg" /></div>
				        </div>
                    	
                    	<a name="description"></a>
                        <div class="pddesc">
                        	<?php echo preg_replace('/<style.*<\/style>/Usi', '',$this->itemDetailArray[0]['content']);?>
                        </div>
                    </div>
                    <div class="pd-alsoLike ibox">
                    	<h2 class="pd-innerH2">CUSTOMER ALSO VIEWED</h2>
						<div class="showbox">
                        	<ul class="clearfix">
                        	<?php for ($i=0; $i < count($this->interrelatedArray); $i++):?>
                            <li>
                                <div class="prd simg"><img alt="<?php echo $this->interrelatedArray[$i]['subject'];?>" title="<?php echo $this->interrelatedArray[$i]
['subject'];?>" src="<?php echo $this->interrelatedArray[$i]['cut_url'];?>" /></div>
                                <div class="prd spname"><a href="<?php echo $this->url
($this->interrelatedArray[$i]['itemid']);?>"><?php echo $this->interrelatedArray[$i]
['subject']?></a></div>
                                <div class="prd sprice"><a class="sprice spbg f-blk" 
href="<?php echo $this->url($this->interrelatedArray[$i]['itemid']);?>">
                                <?if($this->interrelatedArray[$i]['min_price']!=$this->interrelatedArray[$i]['max_price']):?>
								Price  <strong>$<?=$this->interrelatedArray[$i]['max_price']?></strong> 
								<?else:?>
								Price  <strong>$<?=$this->interrelatedArray[$i]['max_price']?></strong> 
								<?endif;?>
                                </a></div>
                                <div><a class="f-blk pboxbar spbg" href="<?php echo $this->url($this->interrelatedArray[$i]['itemid']);?>">&nbsp;</a></div>
                            </li>
                           
                            <?php endfor;?>                            
                        </ul>
                        </div>
                    </div>
                     <div class="ibox_pages clearfix">
                    	<span class="pre" title="pre page"></span>
                    	<span class="num"></span>
                    	<span class="next" title="next page"></span>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
	<div class="fcj_blk0 w-blk-customize" id="custom_size" style="display: none; position:absolute; top:110px; left:130px;">
        <h2 class="blk0h2 f-iblk clearfix">
            <span class="spbg blkhdl"></span>
            <span class="spbg blkhdr"><input class="spbg" type="button" value="I DON'T WANT TO CUSTOMIZE" id="i_dont_want_to_sustomize" onclick="GGSHOP.product.close();"/></span>
        </h2>
        <div class="blkbody">
        	<div class="inner-blkbody">  
        		<div style="width:100%;height: 20px;">
	        		<div style="float:right;margin-top:5px;margin-right:5px;">
						<span style="padding-right:10px;">Add One More Pattern:</span><input class="add" type="button" value="" onclick="GGSHOP.product.addParam();"/>
	            	</div> 
	            </div>
	            <?php ?>     		
        		<div class="custom-item-content">
            	<div class="custom-item clearfix" style="border: none; padding: 0; background: none;">
                	<div class="custom-left clearfix" style="padding:10px; padding-top: 0; border:1px #CCC solid; margin:10px 0px;border-radius: 6px 6px 6px 6px; background:url(../images/custom-bar.png) repeat-x top; width: 660px;">
                    	<div class="citem citem1" style="padding-top:10px;">
                    		<div style="padding-bottom:10px;font-weight:bold;">Step1:</div>
                        	<label>Size:</label>&nbsp;
                            <select name="printshirtSize[]">
                            	<?php foreach($this->pattern_size as $value):?>
                                	<option value="<?php echo $value;?>"><?php echo $value;?></option>
                                <?php endforeach;?>                            	
                            </select>
                        </div>
                       
                        <div class="citem citem2 spbg">
                        	<?php if(($this->itemDetailArray[0]['prooriginalnumber'] && count($this->select_Original) > 0 && $this->itemDetailArray[0]['proPrintnumber']) || ($this->itemDetailArray[0]['proocustomizeriginal'] && $this->itemDetailArray[0]['proPrintnumber']) ||(!$this->itemDetailArray[0]['proocustomizeriginal'] && $this->itemDetailArray[0]['proPrintnumber'])):?>
                        	<div style="padding-bottom:10px;font-weight:bold;">Step2(<span style="color:red;">optional</span>):</div>
                        <?php endif;?>
                            <?php //有原版号并且存在明星号 或者自定义原版，且设置了可以打印号?>
                        	<?php if((($this->itemDetailArray[0]['prooriginalnumber'] && count($this->select_Original) > 0) ||  $this->itemDetailArray[0]['proocustomizeriginal'])&& $this->itemDetailArray[0]['proPrintnumber']):?>
                        	<?php //可以自定义原版号?>                        	
                            <?php if ($this->itemDetailArray[0]['proocustomizeriginal'] && $this->itemDetailArray[0]['proPrintnumber']):?>
                            <div>Customize with official style (<a style="color:red;font-size:13px" href="html/jerseyinfo.html" target="_blank">?</a>): +$<?php echo PRINT_ORIGINAL_PRICE;?></div>
                            <div>
                            	<label>Number:</label>
                                <input type="text" name="printshirtNumCus[]" class="numName-ipt" />
                                <label>&nbsp;&nbsp;Name:</label>
                                <input type="text" name="printshirtNameCus[]" class="numName-ipt" />
                            </div>                           
                            <div style="font-size: 10px;">Names can contain up to 12 letters A – Z. <br/>Numbers can only contain numbers 0 – 99.</div>
                            <?php //有原版球星?>
                            <?php if (($this->itemDetailArray[0]['prooriginalnumber'] && count($this->select_Original) > 0)):?>
                            <div>Also you can: </div>
                            <?php //没有原版球星，需要两个input以便加入购物车的时候获取值?>
                            <?php else:?>
                            	<input id="printorginal_select_0" class="crdio" type="radio" name="printorginal_0" value="1" checked style="display: none;"'/>
                            	<input name="Originalnum[]" value="" type="hidden" id='select_Original_tags_0' size="12" />
                            <?php endif;?>
                            <?php //只设置了原版号，但是没有自定义原版号;?>
                            <?php elseif (($this->itemDetailArray[0]['prooriginalnumber'] && count($this->select_Original) > 0) && !$this->itemDetailArray[0]['proocustomizeriginal'] && $this->itemDetailArray[0]['proPrintnumber']):?>
                            <div>
                            	<input type="hidden" name="printshirtNumCus[]" />
                            	<input type="hidden" name="printshirtNameCus[]" />
                            </div>
                            <?php endif;?>
                            <?php //原版球星?>
                            <?php if (($this->itemDetailArray[0]['prooriginalnumber'] && count($this->select_Original) > 0)):?>
                        	<div>
                            	<input id="printorginal_select_0" class="crdio" type="radio" name="printorginal_0" value="1" checked <?php if ($this->itemDetailArray[0]['proocustomizeriginal']) {echo 'style="display: none;"';}?>/><label for="printorginal_select_0"><?php if (!$this->itemDetailArray[0]['proocustomizeriginal']) {echo '&nbsp';}?>Select a player from roster</label>
                            	<input name="Originalnum[]" onclick="GGSHOP.product.checkRadio(this);" value="" type="text" id='select_Original_tags_0' size="12" />
                            </div>  
                            <?php endif;?>                          
                            <?php endif?>   
                            <?php //后台不允许自定义原版号，但是设置了印号?> 
                            <?php if ((!$this->itemDetailArray[0]['proocustomizeriginal']) && $this->itemDetailArray[0]['proPrintnumber']):?>
                            <div>                            	
                            	<input id="printorginal_noselect_0" class="crdio" type="radio" name="printorginal_0" checked value="0" <?php if (!($this->itemDetailArray[0]['prooriginalnumber'] && count($this->select_Original))) {echo 'style="display: none"';}?>/>
                            	<label for="printorginal_noselect_0">Customize with <span style="color: red">Basic style (<a style="color: red" href="html/jerseyinfo.html" target="_blank">?</a>)+$<?php echo PRINT_CUSTOM_PRICE;?></span>:</label><br/>
                            	<div></div>
                            	<label>Number:</label>
                                <input type="text" name="printshirtNum[]" class="numName-ipt" onclick="GGSHOP.product.checkRadio(this);"/>
                                <label>&nbsp;&nbsp;Name:</label>
                                <input type="text" name="printshirtName[]" class="numName-ipt" onclick="GGSHOP.product.checkRadio(this);"/>
                            </div>
                            <div style="font-size: 10px;">Names can contain up to 12 letters A – Z. <br/>Numbers can only contain numbers 0 – 99.</div>
                            <?php endif;?>
                        </div>
            
                        <?if (!empty($this->select_badgepatch)):?>
                        
                        <div class="citem citem3 spbg"  style="padding-top:10px;">
                        <?php if(($this->itemDetailArray[0]['prooriginalnumber'] && count($this->select_Original) > 0 && $this->itemDetailArray[0]['proPrintnumber']) || (($this->itemDetailArray[0]['prooriginalnumber'] && count($this->select_Original) > 0) && $this->itemDetailArray[0]['proocustomizeriginal'] && $this->itemDetailArray[0]['proPrintnumber']) ||(!$this->itemDetailArray[0]['proocustomizeriginal'] && $this->itemDetailArray[0]['proPrintnumber'])):?>
                        	<div style="padding-bottom:10px;font-weight:bold;">Step3(<span style="color:red;">optional</span>):</div>
                        <?php else:?>
                        	<div style="padding-bottom:10px;font-weight:bold;">Step2(<span style="color:red;">optional</span>):</div>
                        <?php endif;?>
                        	<label>Patch:</label>
                        	<input name="select_badgepatch[]" value="" type="text" id='select_badgepatch_tags_0' size="12" />
                        </div>
                        
                        <?php endif;?>

			<?if (!empty($this->select_badgepatch)):?>
                        <div class="citem citem4 spbg" style="padding-top:10px;">
                        <?php if(($this->itemDetailArray[0]['prooriginalnumber'] && count($this->select_Original) > 0 && $this->itemDetailArray[0]['proPrintnumber']) || (($this->itemDetailArray[0]['prooriginalnumber'] && count($this->select_Original) > 0) && $this->itemDetailArray[0]['proocustomizeriginal'] && $this->itemDetailArray[0]['proPrintnumber']) ||(!$this->itemDetailArray[0]['proocustomizeriginal'] && $this->itemDetailArray[0]['proPrintnumber'])):?>
                        	<div style="padding-bottom:10px;font-weight:bold;">step4:</div>
                        <?php else:?>
                        <div style="padding-bottom:10px;font-weight:bold;">Step3:</div>
                        <?php endif;?>
			<?php else:?>
			<div class="citem citem4 spbg" style="padding-top:10px;">
                        <div style="padding-bottom:10px;font-weight:bold;">Step3:</div>
            <?php endif;?>

                        	<div><label>Amount:&nbsp;</label><input value="1" onkeyup="this.value=this.value.replace(/[^\d]/g,'')" type="text" name="printshirtAmount[]" size="6"/></div>
                        </div>
                        	
                        
                        
                    </div>
                    <div class="custom-right">
                    	
                    </div>
                </div> 
                </div>
                <div class="clear"></div>
                <?php if($this->adata):?>
                <div class="box pdp-pajamafybox_shorts center rounded" id="productlink" style="padding: 16px 25px 16px 25px !important;"> Would you like to add matching accessory to your shirt?<span class="rounded" id="pdp-pajamafy-shownow" onclick="showproduct();">Show Products</span>
                </div>                              
                <div  style="width:600px;margin:auto;display:none;border:1px solid #CCCCCC;border-top:0px;padding: 16px 25px 16px 25px !important;" id="allproduct">
                	<h3 style="padding-bottom:5px;">Add Matching Accessory:</h3>
                	<?php foreach($this->adata as $key=>$value):?>
                	<div class="all_product">
                		<div style="float:left;padding-bottom:5px;padding-top:5px;"><span>Select Product:</span><span id="accessoryName"><?php echo $value['subject'];?></span>
                		</div>
                		<div class="clear";></div>
                		<div style="float:left;" id="all_product">
                        	
                        	<div class="pdp-pajamafy-swatch" id="product_<?php echo $value['accessoryid'];?>">
                            	<img width="45" height="45" src="<?php echo $value['cut_url'];?>" alt="<?php echo $value['subject'];?>" title="<?php echo $value['subject'];?>" >
                            	<input type="hidden" value="<?php echo $value['subject'];?>" name="subject[]">
                            	<input type="hidden" value="<?php echo $value['accessoryid'];?>" name="accessoryid[]">
                            	<input type="hidden" value="<?php echo $value['price'];?>" name="price[]">
                            	<input type="hidden" value="0" name="flag[]" id="flag_<?php echo $value['accessoryid'];?>">
                            
                            </div>
                            
                            
                        </div>
                        
                        <div class="clear";></div>
                        <div id="pdp-form-sizeblock">

							<div class="full_cont">
								<div style="font-size:11px;margin-bottom:20px; border-top:none; border-right:none; border-left:none; border-bottom: 1px solid #CCCCCC; color: #333333;width:408px;" class="details_personalisation">
									<span style="font-size: 1.2em; width: 600px; float: left;padding-bottom:10px;">Complete the steps below before adding to your basket</span>
									<p style="margin:10px 5px 10px 5px;">
										<label style="margin-right:10px;">Select Size:</label>
										<span class="sz">
											<select name="accessorysize[]" class="inputbox" id="accessorysize" onchange="changeproduct(this,<?php echo $value['accessoryid'];?>)">
											  <option value="">Select</option>
											  <?php foreach($value['accessory_size'] as $val):?>
											  <option value="<?php echo $val;?>"><?php echo $val;?></option>
											  <?php endforeach;?>
											</select>
										</span>
										<span ><label style="margin-right:10px;margin-left:10px;">Quantity:</label><input type="text" name="quantity[]" class="checkem" size="10"></span>
									</p>
	                			</div>
	                		</div>
	                	</div>
                	</div>
                	<?php endforeach;?>
                </div>
                <?php endif;?>
            	
                
                <div class="custom-save">
                	<input type="button" class="spbg caddTo" value="ADD TO SHOPPING CART" onclick="GGSHOP.product.addcart();"/>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:void(0)" onclick="GGSHOP.product.close();">Cancel</a>
                </div>
            </div>
        </div>
        </div>
</form>
<script type="text/javascript">

$(function(){
	var $cur = 1;
	var $i = 4;
	var $len = $('.showbox>ul>li').length;
	var $pages = Math.ceil($len / $i);
	fillPages($pages);
	var $w = $('.ibox').width();
	var $showbox = $('.showbox');
	var $num = $('span.num a');
	var $pre = $('span.pre');
	var $next = $('span.next');
	var $autoFun;
	var $autoFun1;
	autoSlide();
	$pre.click(function(){
		if (!$showbox.is(':animated')) {
			if ($cur == 1) {
				$showbox.animate({left: '-=' + $w * ($pages - 1)},500);
				$cur = $pages;
			}
			else {
				$showbox.animate({left: '+=' + $w},500);
				$cur--;
			}
			$num.eq($cur - 1).addClass('numcur').siblings().removeClass('numcur');
		}
	});
	$next.click(function(){
		if (!$showbox.is(':animated')) {
			if ($cur == $pages) {
				$showbox.animate({left: 0},500);
				$cur = 1;
			}
			else {
				$showbox.animate({left: '-=' + $w},500);
				$cur++;
			}
			$num.eq($cur - 1).addClass('numcur').siblings().removeClass('numcur');
		}
	});
	$num.click(function(){
		if (!$showbox.is(':animated')) {
			var $index = $num.index(this);
			$showbox.animate({left: '-' + ($w * $index)},500);
			$cur = $index + 1;
			$(this).addClass('numcur').siblings().removeClass('numcur');
		}
	});
	function fillPages(pages)
	{
		pages_str = "";
		for(i=1;i<=pages;i++)
		{
			if(i==1)
				pages_str += "&nbsp;<a href='javascript:;' class='numcur'>"+i+"</a>&nbsp;";
			else
				pages_str += "&nbsp;<a href='javascript:;'>"+i+"</a>&nbsp;";
		}
		$('span.num').html(pages_str);
	}
	function clearFun(elem){
		elem.hover(function(){clearAuto();},function(){autoSlide();});
	}
	function autoSlide(){
		$autoFun = setTimeout(autoSlide, 3000);
		$autoFun1 = setTimeout(autoSlide1, 3000);
	}
	function autoSlide1(){
		if (!$showbox.is(':animated')) {
			if ($cur == $pages) {
				$showbox.animate({left: 0},500);
				$cur = 1;
			}
			else {
				$showbox.animate({left: '-=' + $w},500);
				$cur++;
			}
			$num.eq($cur - 1).addClass('numcur').siblings().removeClass('numcur');
		}
	}
	function clearAuto(){
		clearTimeout($autoFun);
		clearTimeout($autoFun1);
	}
	clearFun($showbox);
	clearFun($pre);
	clearFun($next);
	clearFun($num);
	$('#showSizeChart').click(function(){
		GGSHOP.msgBox.show('Size Chart','<img src="http://www.fancycheapjersey.com/html/upload/item_img/201212/1/0135513058091645314sizechart.jpg" style="width:408px;height:258px;" />','540','324','382');
		GGSHOP.msgBox.content.css({"left":($(window).width()-459)/2+"px", "top": $(document).scrollTop(), "z-index": 9999999});
		return false;
	});
});
</script>
<script type="text/javascript">
$('#gallery a').lightBox({
	overlayOpacity: 0.6,
	imageLoading: ROOT_PATH + '/html/images/box/loading.gif',
	imageBtnClose: ROOT_PATH + '/html/images/box/close.gif',
	imageBtnPrev: ROOT_PATH + '/html/images/box/prev.gif',
	imageBtnNext: ROOT_PATH + '/html/images/box/next.gif',
	txtImage: 'Product images'
	}
);
function showproduct(){
	$("#allproduct").toggle();
	$("#allproduct1 input[name='flag[]']").val(0);
	if($("#productlink #pdp-pajamafy-shownow").html()=="Show Products"){
		
		$("#allproduct input[name='flag[]']").val(1);
		
		$("#productlink #pdp-pajamafy-shownow").html("Remove");
		
	}else{
		$("#allproduct input[name='flag[]']").val(0);
		$(".pdp-pajamafy-swatch-selected").addClass('pdp-pajamafy-swatch').removeClass('pdp-pajamafy-swatch-selected');
		$("#productlink #pdp-pajamafy-shownow").html("Show Products");
	}
	
}
function showmyproduct(){
	$("#allproduct  input[name='flag[]']").val(0);
	if($("#producthtml").children().html()=="Show Products"){
		$("#productlink1").after("<div id=\"allproduct1\">"+$("#allproduct").html()+"</div>");
		$("#allproduct1 > input[name='flag[]']").val(1);
		
		$("#producthtml").children().html("Remove");
	}else{
		$("#allproduct1 input[name='flag[]']").val(0);
		$("#producthtml").children().html("Show Products");
		$("#allproduct1").remove();
	}
	$("#custom_size").hide();
}
function changeproduct(mythis,id){
	if($(mythis).val()!=""){
		$("#flag_"+id).val(1);
		$("#product_"+id).addClass('pdp-pajamafy-swatch-selected').removeClass('pdp-pajamafy-swatch');
	}else{
		$("#flag_"+id).val(0);
		$("#product_"+id).addClass('pdp-pajamafy-swatch').removeClass('pdp-pajamafy-swatch-selected');
	}


	
}

//初始化模拟SELECT框
function divSelectInit()
{
	<?php if (OLDBADGE):?>
		<?if (!empty($this->select_badgepatch)):?>
		if(GGSHOP.product.select_badgepatch_vars == null)
		{
		GGSHOP.product.select_badgepatch_vars = new Array();
		<?foreach($this->select_badgepatch as $sbk=>$value) {
	    	$select_badgepatch_obj = split('\|',$value);
		?>
		GGSHOP.product.select_badgepatch_vars[<?=$sbk?>] = new Array();
		GGSHOP.product.select_badgepatch_vars[<?=$sbk?>]['key'] = "<?=$select_badgepatch_obj[0]?>";
		<?php if(isset($select_badgepatch_obj[1])): ?>
		GGSHOP.product.select_badgepatch_vars[<?=$sbk?>]['img'] = "<?=$select_badgepatch_obj[1]?>";
		<?php endif; ?>
		<?php }?>
		$("#select_badgepatch_tags_0").divSelect({data:GGSHOP.product.select_badgepatch_vars,parentclose:'#i_dont_want_to_sustomize'});
		}
		<?php endif;?>
	<?php else:?>
		<?if (!empty($this->select_badgepatch)):?>
		if(GGSHOP.product.select_badgepatch_vars == null)
		{
		GGSHOP.product.select_badgepatch_vars = new Array();
		<?foreach($this->select_badgepatch as $sbk=>$value) {
	    	
		?>
		GGSHOP.product.select_badgepatch_vars[<?=$sbk?>] = new Array();
		GGSHOP.product.select_badgepatch_vars[<?=$sbk?>]['key'] = "<?=$value['badge_name'] . ' $' . $value['badge_price']?>";
		GGSHOP.product.select_badgepatch_vars[<?=$sbk?>]['display'] = "<?=$value['badge_name'] . ' Price $' . $value['badge_price']?>";
		<?php if(!empty($value['img'])): ?>
		GGSHOP.product.select_badgepatch_vars[<?=$sbk?>]['img'] = "<?=$value['img']?>";
		<?php endif; ?>
		<?php }?>
		$("#select_badgepatch_tags_0").divSelect({data:GGSHOP.product.select_badgepatch_vars,parentclose:'#i_dont_want_to_sustomize'});
		}
		<?php endif;?>
		
	<?php endif;?>

	<?php if(!empty($this->select_Original)):?>
	if(GGSHOP.product.select_Original_vars == null)
	{
	GGSHOP.product.select_Original_vars = new Array();
	<?php foreach($this->select_Original as $sok=>$value):?>
	GGSHOP.product.select_Original_vars[<?=$sok?>] = new Array();
	GGSHOP.product.select_Original_vars[<?=$sok?>]['key'] = "<?=$value?>";
	<?php endforeach;?>
	$("#select_Original_tags_0").divSelect({data:GGSHOP.product.select_Original_vars,parentclose:'#i_dont_want_to_sustomize',callback:function(obj,v){
		GGSHOP.product.changeSelect(obj, v);
	}});
	}
	<?php endif;?>
}
</script>
<script src="<?=MY_URL?>/html/scripts/shop/shop.js"></script>
<script src="<?=MY_URL?>/html/scripts/jquery.divSelect.js"></script>
<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
<script type="text/javascript" src="http://apis.google.com/js/plusone.js"></script>